package net.suncaper.demo.service;

import net.suncaper.demo.domain.Hotel;
import net.suncaper.demo.domain.HotelExample;
import net.suncaper.demo.domain.RegionExample;
import net.suncaper.demo.mapper.HotelMapper;
import net.suncaper.demo.mapper.RegionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class HotelServiceImpl implements HotelService {

    @Autowired
    private HotelMapper hotelMapper;

    @Autowired
    private RegionMapper regionMapper;

    @Override
    public List<Hotel> allHotel() {
        HotelExample example=new HotelExample();
        return hotelMapper.selectByExample(example);
    }

    @Override
    public Long selectByCityName(String city) {
        return regionMapper.selectByCityName(city);
    }



    @Override
    public List<Hotel> selectByInput1(Long cityID, String key, String time,int roomnum) {
        return hotelMapper.selectByInput1(cityID,key,time,roomnum);
    }

    @Override
    public List<Hotel> selectByInput2(Long cityID, String key, String time, double pricelow, double pricehigh, double score, int star,int roomnum) {
        return hotelMapper.selectByInput2(cityID,key,time,pricelow,pricehigh,score,star,roomnum);
    }

    @Override
    public Hotel selectByID(Long cityID, Long hotelID) {
        return hotelMapper.selectByID(cityID,hotelID);
    }


//    @Override
//    public List<Hotel> findHotel(String dest,String key) {
//        return dao.findhotel(dest,key);
//    }
//
//    @Override
//    public List<Hotel> findHoteldetail(String dest, String key, int star, int breakfast, double score, double lowprice, double highprice) {
//        return dao.findhoteldetail(dest,key,star,breakfast,score,lowprice,highprice);
//    }
//
//    @Override
//    public Hotel findhotelbyid(long id) {
//        return dao.findhotelbyid(id);
//    }
//
//    @Override
//    public ArrayList<RoomType> findtypebyid(String id) {
//        return dao.findtypebyid(id);
//    }


}